﻿// See https://aka.ms/new-console-template for more information
int x = 0, y = 0;
ConsoleKey input;

do
{
    Console.Clear();//清空
    Console.SetCursorPosition(x, y);
    Console.Write("HELLO");//输入
    input = Console.ReadKey(true).Key;//改变值
    switch (input)
    {
        case ConsoleKey.A:
            if (x > 0)
                x--;
            break;
        case ConsoleKey.D:
            if (x < 100)
                x++;
            break;
        case ConsoleKey.W:
            if (y > 0)
                y--;
            break;
        case ConsoleKey.S:
            if (y < 80)
                y++;
            break;
        default: break;
    }
} while (input != ConsoleKey.Enter);

